﻿using System;
using Unity.VisualScripting;
using UnityEditor;
using UnityEngine;

namespace EditorFrameWork
{
    [CustomEditorWindow(2)]
    public class GUIBaseExample: EditorWindow
    { 
        private Label m_Label1 = new Label("123");
        private Label m_Label2 = new Label("456");

        private void OnGUI()
        {
            m_Label1.OnGUI(default);
            m_Label2.OnGUI(default);
        }

        public class Label : GUIBase
        {
            public Label(string text)
            {
                mText = text;
            }
            private string mText;

            public override void OnGUI(Rect position)
            {
                GUILayout.Label(mText);   
            }

            protected override void OnDispose()
            {
                mText = null;
            }
        }
    }
}